<link href="https://cdn.bootcss.com/picnic/6.5.0/picnic.min.css" rel="stylesheet">
<link href="https://cdn.bootcss.com/picnic/6.5.0/plugins.min.css" rel="stylesheet">

<table style="margin: 3px; width: 100%">
    <tbody>
    <?php $tmp_day = ''?>
    <?php foreach ($list as $rowid => $row): $row_id = $row['id'];?>
    <?php if($row['add_day'] != $tmp_day): $tmp_day = $row['add_day']; ?>
    <tr> <td colspan="2"><?= $row['add_day'] ?> &nbsp;更新</td> </tr>
    <?php endif; ?>
    <tr data-id="<?= $row_id ?>">
        <td><?= nl2br($row['content']); ?></td>
        <td style="text-align: right">
            <button onclick="ok(this)" class="success" id="<?= $row_id ?>_ok">ok</button>
            <button onclick="del(this)" class="warning" id="<?= $row_id ?>_no">no</button>
        </td>
    </tr>
    <?php endforeach; ?>
    </tbody>
</table>

<script>
    function del(obj) {
        obj.style.display='none';
        var nodeTr = obj.parentNode.parentNode;
        var rowid = nodeTr.getAttribute('data-id');
        $("#"+rowid+'_ok').show();
        $.post(replayDelUrl, {id:rowid}, function (msg) {
            console.log(msg);
        });
    }

    function ok(obj) {
        obj.style.display='none';
        var nodeTr = obj.parentNode.parentNode;
        var rowid = nodeTr.getAttribute('data-id');
        $("#"+rowid+'_no').show();
        $.post(replayOkUrl, {id:rowid},function (msg) {
            console.log(msg);
        });
    }
</script>